<template>
  <div class="table">
    <a-row>
      <a-col :span="24" class="cell field">
        <a-space :size="16">
          <a-tag>Canceled</a-tag>
          <span>
            <e-icon type="date" font-size="16px" line-height="17px" />
            {{ dayjs(record.createOn).format('YYYY-MM-DD HH:mm') }}
          </span>
          <span>
            <e-icon type="SalesPersonnel" font-size="16px" line-height="17px" />
            {{ record.phaseUserName }}
          </span>
        </a-space>
      </a-col>
    </a-row>
    <a-row>
      <a-col :span="4" class="cell field">Reason</a-col>
      <a-col :span="20" class="cell value">{{ record.reason }}</a-col>
    </a-row>
  </div>
  <a-divider dashed />
</template>

<script setup>
import EIcon from '@/components/EIcon.vue'
import dayjs from 'dayjs'
defineProps({
  record: {
    type: Object,
    default() {
      return {}
    }
  }
})
</script>

<style lang="less" scoped>
@border: 1px solid @lighter-gray;
.table {
  border: @border;
  .cell {
    padding: 10px 14px;
    border-bottom: @border;
    border-right: @border;
    &:last-child {
      border-right: none;
    }
    &.field {
      background-color: @milk;
      color: @text-gray;
    }
  }
  .ant-row:last-child {
    .cell {
      border-bottom: none;
    }
  }
  .ant-tag {
    background-color: @phase-default;
    border: none;
    padding: 1px 12px;
    font-size: 14px;
    &.contact-tag {
      color: @black;
    }
    &.attachment-tag {
      color: @primary-color;
      cursor: pointer;
      user-select: none;
      .e-icon {
        color: @text-gray !important;
      }
    }
  }
}
</style>
